<template>
	<view class="box">
		<view class="jiner">
			可提现金额
		</view>
		<view class="price">
			<view class="pic">
				{{centerDetail.distribut_money}}
			</view>
			<view class="txt">
				元
			</view>
		</view>

		<view class="tag">
			累计提现{{centerDetail.distribut_money_can}}元
		</view>

		<view class="btn" @click="$navTo('pages/mines/withdrawInfo')">
			提现
		</view>

		<!-- 	<view class="list">
			<view class="nav-box" style="justify-content: center;">
				<view class="left">
					<view class="t">已到账</view>
					<view class="pic">
						<view class="">18.50</view>
						<view class="" style=" font-size: 28rpx;">元</view>
					</view>
					<view class="xian"></view>
				</view>
				<view class="right">
					<view class="t">已到账</view>
					<view class="pic">
						<view class="">18.50</view>
						<view class="" style=" font-size: 28rpx;">元</view>
					</view>
				</view>
			</view>

			<view class="li-box">
				<view class="li" v-for="item in record" :key="item.id">
					<image :src="item.head_pic" class="img"></image>
					<view class="content">
						<view class="title">
							{{item.status_name}}
						</view>
						<view class="vtitle">
							{{item.add_at}}
						</view>
					</view>
					<view class="pric">
						{{item.real_fee}}元
					</view>
				</view>
			</view>
		</view> -->
	</view>
</template>

<script>
	import {
		DistributionApi
	} from '@/api';
	export default {
		data() {
			return {
				centerDetail: {},
				record: [],
			};
		},
		onLoad() {
			this.initData()
		},
		methods: {
			initData() {
				// 分销中心
				DistributionApi.distributeCenter()
					.then(res => {
						this.centerDetail = res.result
					})
					.catch(err => {
						this.$showToast(err || '加载金额失败')
					})
				DistributionApi.withdrawLog({
						size: 99999,
						p: 1
					})
					.then(res => {
						this.record = res.result.rows
					})
					.catch(err => {
						this.$showToast(err || '加载提现记录失败')
					})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		background: #f22438;
		width: 100vw;
		height: 100vh;
		box-sizing: border-box;
		padding: 0 30rpx;
		padding-top: 50rpx;

		.list {
			width: 690rpx;
			height: 874rpx;
			border-radius: 20rpx;
			padding: 20rpx;
			background: #ffffff;
			box-sizing: border-box;
			margin-top: 44rpx;

			.li-box {
				width: 100%;
				height: calc(100% - 150rpx);
				overflow-y: auto;
				margin-top: 40rpx;

				.li {
					width: 100%;
					height: 93rpx;
					opacity: 1;
					display: flex;
					align-items: center;
					margin-bottom: 60rpx;

					.pric {
						font-size: 38rpx;
						color: #ff0000;
					}

					.img {
						width: 93rpx;
						height: 93rpx;
						border-radius: 50%;
					}

					.content {
						flex: 1;
						margin-left: 20rpx;

						.title {
							font-size: 30rpx;
						}

						.vtitle {
							margin-top: 25rpx;
							font-size: 26rpx;
							color: #bbbbbb;
						}
					}
				}
			}

			.nav-box {
				width: 100%;
				height: 110rpx;
				box-sizing: border-box;
				display: flex;

				>view {
					flex: 0 0 50%;
					height: 100%;
				}

				.xian {
					width: 84rpx;
					height: 7rpx;
					border-radius: 50rpx;
					opacity: 1;
					border: 1rpx solid #f22438;
					background: #f22438;
				}

				.right {
					color: #979797;
				}

				.left,
				.right {
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					align-items: center;

					.pic {
						text-align: center;
						display: flex;
						align-items: center;
						font-size: 46rpx;
					}

					.t {
						color: #828282;
						font-size: 28rpx;
					}


				}
			}

		}

		.btn {
			width: 690rpx;
			height: 94rpx;
			border-radius: 10rpx;
			opacity: 1;
			border: 1rpx solid #d8d8d8;
			background: linear-gradient(180deg, #fff6ea 0%, #fed3a4 100%);
			text-align: center;
			line-height: 94rpx;
			font-size: 32rpx;
			color: #a05c3e;
			margin-top: 40rpx;
		}

		.tag {
			width: 264rpx;
			height: 59rpx;
			border-radius: 50rpx;
			opacity: 1;
			// border: 1rpx solid #d8d8d8;
			background: #f56773;
			font-size: 28rpx;
			line-height: 59rpx;
			text-align: center;
			margin: 0rpx auto;
			color: #fff;
		}

		.price {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;

			.pic {
				font-size: 78rpx;
				color: #fff;
			}

			.txt {
				color: #fff;
				font-size: 40rpx;
				margin-left: 10rpx;
			}

		}

		.jiner {
			font-size: 30rpx;
			font-weight: 400;
			color: #fff;
			width: 150rpx;
			margin: 0rpx auto;

		}
	}
</style>